CREATE  TABLE jms_dm.dm_upload_in_time_detail_dt(
 item_type varchar(50) NULL COMMENT "明细类型other(其他),sign(正常签收),collect(代签收),transfer(中转),taking(揽收),deliver(派件)",
 manage_code varchar(50) NULL COMMENT "管理大区code",
 agent_code varchar(50) NULL COMMENT "代理编码",
 fran_code varchar(50) NULL COMMENT "加盟商code",
 network_code varchar(50) NULL COMMENT "责任网点编码",
 billcode varchar(50) NULL COMMENT "运单号",
 network_name varchar(100) NULL COMMENT "责任网点名称",
 scan_type varchar(100) NULL COMMENT "扫描类型",
 scan_time datetime NULL COMMENT "扫描时间",
 upload_time datetime NULL COMMENT "上传时间",
 consume_time int(11) NULL COMMENT "上传时长（分钟）",
 status int(11) NULL COMMENT "状态1有效0无效",
 create_time datetime NULL COMMENT "创建时间",
 update_time datetime NULL COMMENT "更新时间",
 recordid varchar(100) NULL COMMENT "扫描主键",
 scanusercode varchar(100) NULL COMMENT "扫描雇员编号",
 scanuser varchar(100) NULL COMMENT "扫描雇员",
 packagecode varchar(50) NULL COMMENT "所属袋号(包号)",
 bscan_time datetime NULL COMMENT "包号的扫描时间",
 bupload_time datetime NULL COMMENT "包号的上传时间",
 pistolid varchar(100) NULL COMMENT "巴枪id",
 source_code varchar(50) NULL COMMENT "订单来源编号(新)",
 source_name varchar(50) NULL COMMENT "订单来源编号(新)",
 network_type int(11) NULL COMMENT "网点类型",
 agent_name varchar(100) NULL COMMENT "代理区名称",
 date_time date NULL COMMENT "查询日期",
 manage_name varchar(50) NULL COMMENT "管理大区name",
 fran_name varchar(100) NULL COMMENT "加盟商名称"
)ENGINE=olap
DUPLICATE KEY(item_type, manage_code, agent_code, fran_code, network_code)
comment '上传及时率明细'
PARTITION BY RANGE (date_time) (
    START ("2023-01-01") END ("2023-02-03") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(scan_type) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-185",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);